
using System;
using System.Collections.Generic;
using System.Text;
using NFinal.Extension;

namespace BlackHtml5.WebSite.Models.Entity.Common
{
    public struct alipay_config:NFinal.IModel
    {
		public System.Int64 id;
		public System.String partner;
		public System.String seller_email;
		public System.String key;
		#region Nullable
		private bool __is_null__;
        public bool __Is_Null__
        {
            get {
                return __is_null__;
            }
            set
            {
                 __is_null__=value;
            }
        }
        public static implicit operator alipay_config(string __value__)
        {
            var __value2__ = new alipay_config();
            __value2__.__Is_Null__ = __value__==null;
            return __value2__;
        }
        public static  bool operator true(alipay_config __value__)
        {
            return !__value__.__is_null__;
        }
        public static bool operator false(alipay_config __value__)
        {
            return !__value__.__is_null__;
        }
		#endregion
		#region 从get列表初始化实体类
		public static bool TryParse(NFinal.NameValueCollection get,out alipay_config par)
		{
			par=new alipay_config();
			try
			{
						System.Int64.TryParse(get["id"],out par.id);
						par.partner=get["partner"];
						par.seller_email=get["seller_email"];
						par.key=get["key"];
			}
			catch
			{
				return false;
			}
			return true;
		}
		#endregion
		#region 写Json字符串
		public void WriteJson(System.IO.TextWriter tw)
		{
			tw.Write("{");
					tw.Write("\"id\":");
					tw.Write(id.ToString());
					tw.Write(",");
					tw.Write("\"partner\":");
					tw.Write("\"");
					tw.Write(partner==null?"null":partner);
					tw.Write("\"");
					tw.Write(",");
					tw.Write("\"seller_email\":");
					tw.Write("\"");
					tw.Write(seller_email==null?"null":seller_email);
					tw.Write("\"");
					tw.Write(",");
					tw.Write("\"key\":");
					tw.Write("\"");
					tw.Write(key==null?"null":key);
					tw.Write("\"");

			tw.Write("}");
		}
		#endregion
    }
}
